import letter_module as letter
import reverse_module as reverse
import enCode_module as enCode

def main():
    # 接收用户输入
    input_str = input("Please enter a string within the length of 0 to 255 characters: ")

    # 验证输入长度
    if 0 <= len(input_str) <= 255:
        # 去除非英文字符
        cleaned_str = letter.remove_non_english_chars(input_str)

        # 反转字符串
        reversed_str = reverse.reverse_string(cleaned_str)

        # 使用凯撒密码加密
        encrypted_str = enCode.caesar_cipher(reversed_str)

        print(f"Encrypted String: {encrypted_str}")
    else:
        print("Invalid input length. Please enter a string with length between 0 and 255.")

if __name__ == "__main__":
    main()
